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

Query time 0.00050