UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q46MdIbgqwnJztONfwEmlCQELu+82gC60+Yg8VUWTzg=' 
WHERE 
  key_id = '893d4891c9033aee05ecb684edf9b4594ae9ed5b3d6b00b266c97b077a82f1f3' 
  AND (
    token = 'Q46MdIbgqwnJztONfwEmlCQELu+82gC60+Yg8VUWTzg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033