UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'He6VUJgF1yveBSpjvs3yy+s8ZibFY48muLLF+KJsZYQ=' 
WHERE 
  key_id = '2fd3dd426cbf8ef7660569d5842aef43c36aed64e1d2388268ffd68726aa1d14' 
  AND (
    token = 'He6VUJgF1yveBSpjvs3yy+s8ZibFY48muLLF+KJsZYQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030