UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/QgIu6W1aHNRxk2obb2icgMR7v/XG1jzi+xNHYkGKeE=' 
WHERE 
  key_id = '0e3d7260d7c134fcaf695a4730352014a47fd45687e197841e1d23b72a525dc5' 
  AND (
    token = '/QgIu6W1aHNRxk2obb2icgMR7v/XG1jzi+xNHYkGKeE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022