UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Kc1n/Pi4McxjxbnSa6rUKbHohE3Wsn28u8qn45WS6fs=' 
WHERE 
  key_id = '5370a4798204351e0c187401c2047400863f2fa44cd32ff4b7ebb4ea0d353487' 
  AND (
    token = 'Kc1n/Pi4McxjxbnSa6rUKbHohE3Wsn28u8qn45WS6fs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031