UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GqlLitNA7yA9N5Ep06/I9yaVeaEdcmqf7jiGutXUz2E=' 
WHERE 
  key_id = '06bb0b4d60e5f4264fc5275c8f55d6b0a809604a324598022ce5d670c82e6aff' 
  AND (
    token = 'GqlLitNA7yA9N5Ep06/I9yaVeaEdcmqf7jiGutXUz2E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042