UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3TNtMqlFp4SGO9cyMzk2O2hRIKi8R9Bxn5W2keatdoU=' 
WHERE 
  key_id = 'c909432d4591d8ae9817d78537de7eb9962cfc492ed2ebeca2d5eb071f5c050b' 
  AND (
    token = '3TNtMqlFp4SGO9cyMzk2O2hRIKi8R9Bxn5W2keatdoU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035