UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+271p86Nl1A6eGe3A2RNnEBaiqL7kDYCrzHHxBnT/kg=' 
WHERE 
  key_id = '936c35fa4629a76e0481535e2606fc83d1ac59718cb0aceb2c1ae9f27ba78f91' 
  AND (
    token = '+271p86Nl1A6eGe3A2RNnEBaiqL7kDYCrzHHxBnT/kg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030