UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b9Jzdl8tLIEZvxt/In5W7hvmCyoTs1j+i/Zb4VVz+Nk=' 
WHERE 
  key_id = '63244d19da5ac7e97fc107eea3dafa63761c99af7155c7656b94b3c1eac58857' 
  AND (
    token = 'b9Jzdl8tLIEZvxt/In5W7hvmCyoTs1j+i/Zb4VVz+Nk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00073