UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qu+iB/lTBmn2gfAhQimAjXr7BeDoZQSpvNZ+Wnren+0=' 
WHERE 
  key_id = 'b7aead84bd2a292e6dbfe82cb4a3726481ff15952b3865f06f29f3436aeeda79' 
  AND (
    token = 'qu+iB/lTBmn2gfAhQimAjXr7BeDoZQSpvNZ+Wnren+0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017