UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lgFBlAMUqyHBwHGlKBIcod861Jy6pi1Y0Jds4uEReTs=' 
WHERE 
  key_id = '8ad2d4a7eea46730a3ada194b309e2c9598a0aa6c182ceba02e968e2a3107dd3' 
  AND (
    token = 'lgFBlAMUqyHBwHGlKBIcod861Jy6pi1Y0Jds4uEReTs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046