UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SxLRQmbq2rG2b081w2kRBOW7SMR42ozozEt1oy2gdwI=' 
WHERE 
  key_id = '81a245f2dc56692c9fcc4341eefc903fdbe4196f58dbb04f0566e940f832b5c0' 
  AND (
    token = 'SxLRQmbq2rG2b081w2kRBOW7SMR42ozozEt1oy2gdwI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037