UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LInNvuDtw8NKxTEc6+EVBLOhJyO6iMcZzzl4HrEHymw=' 
WHERE 
  key_id = 'c6fc8866a9d0fa46b4cf9ecefc9a5f287ec84aa149fdaac9e03b6d605f57095f' 
  AND (
    token = 'LInNvuDtw8NKxTEc6+EVBLOhJyO6iMcZzzl4HrEHymw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045