UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xpPk5nYOXmBDophW3iHjtDI6y6M5bUWFYVMRWVOfl/I=' 
WHERE 
  key_id = '6f877739094e1fd6809554499c883fdd90484fcc56bc6f046dcee53870de3ee0' 
  AND (
    token = 'xpPk5nYOXmBDophW3iHjtDI6y6M5bUWFYVMRWVOfl/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038