UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+27DBTqKTFhOOINGhdsQHGudXswDu8LJOjDA6fD/BUg=' 
WHERE 
  key_id = '51a8ecc34dab447894f4d8fce255075d2c65310198f6e752f16da8cc9ccf7aa8' 
  AND (
    token = '+27DBTqKTFhOOINGhdsQHGudXswDu8LJOjDA6fD/BUg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033