UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yJaMKT+JhDDXZLfhtgkUbVqBclxYBcln6GgsFyEhUow=' 
WHERE 
  key_id = '8c004b2c287a17e1b9eb9a75079c2d2e444bd5e8c853b82287b391bd83f8142c' 
  AND (
    token = 'yJaMKT+JhDDXZLfhtgkUbVqBclxYBcln6GgsFyEhUow=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00127