UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xem3ku6QUnLwRYS9+cWd5C1wXLEhWJMTYhpek9QOJPs=' 
WHERE 
  key_id = 'fda67bfebbb08f3dfdf31b1537c86e631887ff5150bff5d71355877b52e66098' 
  AND (
    token = 'xem3ku6QUnLwRYS9+cWd5C1wXLEhWJMTYhpek9QOJPs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033