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

Query time 0.00048