UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2JPgv/sWHLIvzd3jrwJ01aPyAps/+6PI8zQI/uyP0nw=' 
WHERE 
  key_id = 'aed53c705b23273077d33dd59dd6c1d789acd7b469774d71fe6a4315d1e1aff5' 
  AND (
    token = '2JPgv/sWHLIvzd3jrwJ01aPyAps/+6PI8zQI/uyP0nw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00088