UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YoYS36sIB/ITdGjnRQ9mk8s3RBFzqdz264NL8NHcpGc=' 
WHERE 
  key_id = 'f74cac22b2cc5bf313341fa5c51ff1189019b25d54b1099d90dd3719578fa77b' 
  AND (
    token = 'YoYS36sIB/ITdGjnRQ9mk8s3RBFzqdz264NL8NHcpGc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00183