UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HHFW/7zgWflDMauXT/cGNX85ls+s+i/e0ISK55N3dug=' 
WHERE 
  key_id = '55a1a9f6f89cc3bfebb3b4e28edd3b4822fa88c8f02c2cec5f65782ccceb7bdf' 
  AND (
    token = 'HHFW/7zgWflDMauXT/cGNX85ls+s+i/e0ISK55N3dug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032