UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UkMREet6zxC3GMWM+S5S3obOGwhD6lkmmzdFLxZi1R4=' 
WHERE 
  key_id = 'd14796dba9224f30a6cb6e42b924ff7549fa388a0634caf18076e879acfa68cf' 
  AND (
    token = 'UkMREet6zxC3GMWM+S5S3obOGwhD6lkmmzdFLxZi1R4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046