UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k7XeEdH/OrmwVBlnelVv97ZI9tbpAdzmD8ZGvHf64iI=' 
WHERE 
  key_id = 'ef0b4d34c426ab7c29a233428cb5e8b7347bba986b2389dee29abe989f13a67d' 
  AND (
    token = 'k7XeEdH/OrmwVBlnelVv97ZI9tbpAdzmD8ZGvHf64iI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047