UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wjqT7QFzrPpPwUyBjx9SZcuMQy3w+/XpNe/3xlUmoLU=' 
WHERE 
  key_id = '4ebf117a2801363bdf467516a408e6169f3e82e2f7b30d4c76b7f261a1258280' 
  AND (
    token = 'wjqT7QFzrPpPwUyBjx9SZcuMQy3w+/XpNe/3xlUmoLU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031