UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TP2FsTrSsWeidowT3BZTkZctFxT22f+ofURBrmI/C7I=' 
WHERE 
  key_id = '6e70ad5909d1fbb19cd809175e6a963050166f6dea81bd0a69dff11c3b23b527' 
  AND (
    token = 'TP2FsTrSsWeidowT3BZTkZctFxT22f+ofURBrmI/C7I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023