UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LghHFxWXjliKNdsuzq1anoAsMy1P2ejJyQX2U/DVJvo=' 
WHERE 
  key_id = '7ae06bd0843ecf6e555b0d47e17de67250752fb3cabd89b12bb2864f242470d8' 
  AND (
    token = 'LghHFxWXjliKNdsuzq1anoAsMy1P2ejJyQX2U/DVJvo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00089