UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y3sK0wgZouQHOcR2KRoSNesTv8Lv96gB1O4XG69qnsg=' 
WHERE 
  key_id = '8ad461bfff384aaf1f8b7806726ff5df5bece8cfb6fb1795f475108a97dc088c' 
  AND (
    token = 'Y3sK0wgZouQHOcR2KRoSNesTv8Lv96gB1O4XG69qnsg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041