UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZmcrA5iSvuicL3//yiZxiRLfoUbMC5jsbRB0ue3vYvY=' 
WHERE 
  key_id = 'f4dbd25514c4de7ec5b7418028e34a0c0d7a7f6d26e388f7cdafadbf735d6650' 
  AND (
    token = 'ZmcrA5iSvuicL3//yiZxiRLfoUbMC5jsbRB0ue3vYvY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041