UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZwlYXiUi5pyXCzxo1A1EbYDm2XMqTgwK6xqEuo+iVk4=' 
WHERE 
  key_id = '5baea61f39ca6b5a50e00b7529707d0070e8288d8e028217c8c4290a99985c23' 
  AND (
    token = 'ZwlYXiUi5pyXCzxo1A1EbYDm2XMqTgwK6xqEuo+iVk4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045