UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jnUW4CiaA1R49r1N6dFlxgZRsUejcN05r3nODx+Yt0A=' 
WHERE 
  key_id = '68ab59d11813b0f2e71412f486022a06a97b1ba06a6838ffff1cf081dd134602' 
  AND (
    token = 'jnUW4CiaA1R49r1N6dFlxgZRsUejcN05r3nODx+Yt0A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029