UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JiTOnK5i/vnM9T+N0DHPacMjz+MgfPkX9A8RnjGkPT8=' 
WHERE 
  key_id = 'ba2b69e3c9d3ca2e342f00f9d5db2380f03cf1936ec5c84b73ff89b5d8e6c872' 
  AND (
    token = 'JiTOnK5i/vnM9T+N0DHPacMjz+MgfPkX9A8RnjGkPT8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031