UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G9FEOgu9iXL2nZdcwgxmqY9PwhKL7+TBWbvZPnuLRPQ=' 
WHERE 
  key_id = '4c3cfd9de5ac3a42d44c16c9aeecc7a4d0fab6b6ea8cb1cf0ef9118866103552' 
  AND (
    token = 'G9FEOgu9iXL2nZdcwgxmqY9PwhKL7+TBWbvZPnuLRPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033