UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RnBEIthHZp4ezIV+eFpPxd4ilDyLYZa0fc2AMwBKQno=' 
WHERE 
  key_id = '757a55c255331120d664a79ec7f84744394c4da2bfce95f1ef2cb06427cc6cc1' 
  AND (
    token = 'RnBEIthHZp4ezIV+eFpPxd4ilDyLYZa0fc2AMwBKQno=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045