UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GUL2jSgUUmTOSyi2K6QCH2gg6FgxO1ueXjPmKHqJFrY=' 
WHERE 
  key_id = 'ea1a0e041869cfe683d479d2897e16901867964d55f2b1fdd5847560a32e6700' 
  AND (
    token = 'GUL2jSgUUmTOSyi2K6QCH2gg6FgxO1ueXjPmKHqJFrY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031