UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tCdrTI8r7iOOub1vkJ60MbS13hTM/DQm1N7QJASweAw=' 
WHERE 
  key_id = 'e61201487099189da338e40d3f6fa5270e39addf0c6f6716d66ff50968a5f8fe' 
  AND (
    token = 'tCdrTI8r7iOOub1vkJ60MbS13hTM/DQm1N7QJASweAw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019