UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zM+tdgxlLnViLgkf/ktaFdaZSVGXTihB9FC/x72vlE8=' 
WHERE 
  key_id = 'dba0c1eb40bbdf0e59dd2b4d994bc82ac9bdbc97c592f3229cbf84c5c9629e20' 
  AND (
    token = 'zM+tdgxlLnViLgkf/ktaFdaZSVGXTihB9FC/x72vlE8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025