UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ji5X/SlknZEPapgt5+QRdfBsCx8oGkYFHwvlalZv4Wk=' 
WHERE 
  key_id = '4550dc5de4bab87b53c5a1b0d178156cca300278dc18ff34e86db9623bd25305' 
  AND (
    token = 'Ji5X/SlknZEPapgt5+QRdfBsCx8oGkYFHwvlalZv4Wk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029